Integrand size = 14, antiderivative size = 48 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=-\frac {\text {arctanh}(\cos (x))}{b}+\frac {a \text {arctanh}\left (\frac {a \cos (x)-b \sin (x)}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3189, 3855, 3153, 212} \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {a \text {arctanh}\left (\frac {a \cos (x)-b \sin (x)}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}}-\frac {\text {arctanh}(\cos (x))}{b} \]
[In]
[Out]
Rule 212
Rule 3153
Rule 3189
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\csc (x)}{b}-\frac {a}{b (b \cos (x)+a \sin (x))}\right ) \, dx \\ & = \frac {\int \csc (x) \, dx}{b}-\frac {a \int \frac {1}{b \cos (x)+a \sin (x)} \, dx}{b} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}+\frac {a \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,a \cos (x)-b \sin (x)\right )}{b} \\ & = -\frac {\text {arctanh}(\cos (x))}{b}+\frac {a \text {arctanh}\left (\frac {a \cos (x)-b \sin (x)}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \\ \end{align*}
Time = 0.14 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.25 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {-\frac {2 a \text {arctanh}\left (\frac {-a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )}{b} \]
[In]
[Out]
Time = 0.52 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.02
method | result | size |
default | \(\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{b}+\frac {2 a \,\operatorname {arctanh}\left (\frac {-2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{b \sqrt {a^{2}+b^{2}}}\) | \(49\) |
risch | \(-\frac {i a \ln \left ({\mathrm e}^{i x}-\frac {i a +b}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, b}+\frac {i a \ln \left ({\mathrm e}^{i x}+\frac {i a +b}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, b}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{b}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{b}\) | \(122\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 142 vs. \(2 (44) = 88\).
Time = 0.29 (sec) , antiderivative size = 142, normalized size of antiderivative = 2.96 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} a \log \left (\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - 2 \, b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (a \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}}\right ) - {\left (a^{2} + b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (a^{2} + b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b + b^{3}\right )}} \]
[In]
[Out]
\[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\int \frac {\cot {\left (x \right )}}{a \sin {\left (x \right )} + b \cos {\left (x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.65 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {a \log \left (\frac {a - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {a^{2} + b^{2}}}{a - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} b} + \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.56 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {a \log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{b} \]
[In]
[Out]
Time = 23.21 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.56 \[ \int \frac {\cot (x)}{b \cos (x)+a \sin (x)} \, dx=\frac {\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )}{b}-\frac {2\,a\,\mathrm {atanh}\left (\frac {\sqrt {a^2+b^2}\,\left (4{}\mathrm {i}\,\sin \left (\frac {x}{2}\right )\,a^2+2{}\mathrm {i}\,\cos \left (\frac {x}{2}\right )\,a\,b+1{}\mathrm {i}\,\sin \left (\frac {x}{2}\right )\,b^2\right )}{a^3\,\sin \left (\frac {x}{2}\right )\,4{}\mathrm {i}+a^2\,b\,\cos \left (\frac {x}{2}\right )\,1{}\mathrm {i}+a\,b^2\,\sin \left (\frac {x}{2}\right )\,3{}\mathrm {i}+b\,\cos \left (\frac {x}{2}\right )\,\left (a^2+b^2\right )\,1{}\mathrm {i}}\right )}{b\,\sqrt {a^2+b^2}} \]
[In]
[Out]